// 添加这一行导入语句
import './style.css';

// 首页专属JS逻辑
console.log('首页加载成功！');

// DOM加载完成后执行
document.addEventListener('DOMContentLoaded', () => {
  const btn = document.getElementById('color-btn');
  const counterEl = document.getElementById('counter');
  const title = document.getElementById('main-title');
  
  let count = 0;
  
  // 按钮点击事件
  btn.addEventListener('click', () => {
    count++;
    counterEl.textContent = `点击次数: ${count}`;
    
    // 随机改变标题颜色
    const randomColor = `hsl(${Math.random() * 360}, 70%, 60%)`;
    title.style.color = randomColor;
    
    // 添加动画效果
    title.animate([
      { transform: 'scale(1)' },
      { transform: 'scale(1.1)' },
      { transform: 'scale(1)' }
    ], {
      duration: 300,
      iterations: 1
    });
  });
  
  // 欢迎消息
  setTimeout(() => {
    title.textContent += ' 🚀';
  }, 1000);
});
